import Vue from 'vue';
import App from './App.vue';
import VueRouter from 'vue-router';
// 引入element-ui
import ElementUI from 'element-ui'
// import 'element-ui/lib/theme-default/index.css'
// import { Button,Dialog } from 'element-ui'
// 懒加载
const Foo = resolve => {require.ensure([], () => {resolve(require('./components/Foo.vue'))})};
const Bar = resolve => {require.ensure([], () => {resolve(require('./components/Bar.vue'))})};

Vue.use(ElementUI);
// Vue.use(Button);
// Vue.use(Dialog);
Vue.use(VueRouter);
const router = new VueRouter({
  mode: 'history',
  routes: [
    {
      path: '/home',
      component: Foo
    },
    {
      path: '/other',
      component: Bar
    }
  ]
});

new Vue({
  el: '#app',
  router,
  render: h => h(App)
});
